The present invention relates generally to the field of computers, and more particularly to database statistics.
Query optimization is a function of many relational database management systems. The query optimizer attempts to determine the most efficient way to execute a given query by considering the possible query plans. A query is a request for information from a database and generally, the query optimizer cannot be accessed directly by users. Once queries are submitted to database server, and parsed by the parser, they are then passed to the query optimizer where optimization occurs. Optimizers in a database system rely on database statistics, such as the number of rows in a table or the number of distinct values in a column to choose or form the best query execution plan to retrieve data needed to run the query.